package lab21;

public class Vegetable {
	private String name;
	
	public Vegetable(String name) {
		this.name=name;
	}
	
	public String getName() {
		return name;
	}
	
	public boolean equals(Object obj){
		if (obj != null && obj instanceof Vegetable && ((Vegetable)obj).name != null)
			return ((Vegetable)obj).name.equals(this.name);
		return false;
	}
	
	@Override
	public String toString() {
		return "Vegetable: " + this.name;
	}
}
